package com.borya.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.ForkJoinPool;

/**
 * 使用Rxjava
 * @author Administrator
 *
 */
public final class AsyncUtils {

	private AsyncUtils(){}
	static final int parallelism = 3 * Runtime.getRuntime().availableProcessors();
	// java8 的  ForkJoinPool
    private static final ExecutorService EXECUTOR = new ForkJoinPool(parallelism);
//    private static final Scheduler SCHEDULER = Schedulers.from(EXECUTOR);

    public static ExecutorService executor() {
        return EXECUTOR;
    }

//    public static Scheduler scheduler() {
//        return SCHEDULER;
//    }
}
